package chapter_7;

import java.io.FileReader;
import java.io.FileWriter;

public class Test8 {
    public static void main(String[] args) throws Exception{
        try(FileWriter fw = new FileWriter("D:\\copy.txt");
            FileReader fr = new FileReader("D:\\str.txt")){
            char[] chars = new char[1024];
            int leght ;
            while ((leght = fr.read(chars))!= -1){
                fw.write(chars,0,leght);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
